home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / DevPac v3.02b.adf / include / exec / libraries.i < prev    next >
Text File  |  1991-11-20  |  3KB  |  122 lines

  1.     IFND    EXEC_LIBRARIES_I
  2. EXEC_LIBRARIES_I    SET    1
  3. **
  4. **    $Filename: exec/libraries.i $
  5. **    $Release: 1.3 $
  6. **
  7. **    
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND EXEC_NODES_I
  14.     INCLUDE "exec/nodes.i"
  15.     ENDC    ; EXEC_NODES_I
  16.  
  17.  
  18. *------ Special Constants ---------------------------------------
  19.  
  20. LIB_VECTSIZE    EQU    6
  21. LIB_RESERVED    EQU    4
  22. LIB_BASE    EQU    $FFFFFFFA    * (-LIB_VECTSIZE)
  23. LIB_USERDEF    EQU    LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE)
  24. LIB_NONSTD    EQU    LIB_USERDEF
  25.  
  26. *----------------------------------------------------------------
  27. *
  28. *   Library Definition Macros
  29. *
  30. *----------------------------------------------------------------
  31.  
  32. *------ LIBINIT sets base offset for library function definitions:
  33.  
  34. LIBINIT        MACRO   * [baseOffset]
  35.         IFC        '\1',''
  36. COUNT_LIB   SET        LIB_USERDEF
  37.         ENDC
  38.         IFNC    '\1',''
  39. COUNT_LIB   SET        \1
  40.         ENDC
  41.         ENDM
  42.  
  43.  
  44. *------ LIBDEF is used to define each library function entry:
  45.  
  46. LIBDEF        MACRO   * libraryFunctionSymbol
  47. \1        EQU        COUNT_LIB
  48. COUNT_LIB   SET        COUNT_LIB-LIB_VECTSIZE
  49.         ENDM
  50.  
  51.  
  52. *----------------------------------------------------------------
  53. *
  54. *   Standard Library Functions
  55. *
  56. *----------------------------------------------------------------
  57.  
  58.     LIBINIT LIB_BASE
  59.  
  60.     LIBDEF  LIB_OPEN
  61.     LIBDEF  LIB_CLOSE
  62.     LIBDEF  LIB_EXPUNGE
  63.     LIBDEF  LIB_EXTFUNC            * reserved *
  64.  
  65.  
  66. *----------------------------------------------------------------
  67. *
  68. *   Standard Library Data Structure
  69. *
  70. *----------------------------------------------------------------
  71.  
  72.  STRUCTURE LIB,LN_SIZE
  73.     UBYTE   LIB_FLAGS
  74.     UBYTE   LIB_pad
  75.     UWORD   LIB_NEGSIZE            * number of bytes before LIB
  76.     UWORD   LIB_POSSIZE            * number of bytes after LIB
  77.     UWORD   LIB_VERSION            * major
  78.     UWORD   LIB_REVISION        * minor
  79.     APTR    LIB_IDSTRING        * identification
  80.     ULONG   LIB_SUM            * the checksum itself
  81.     UWORD   LIB_OPENCNT            * number of current opens
  82.     LABEL   LIB_SIZE
  83.  
  84.  
  85. *------ LIB_FLAGS bit definitions:
  86.  
  87.     BITDEF  LIB,SUMMING,0        * we are currently checksumming
  88.     BITDEF  LIB,CHANGED,1        * we have just changed the lib
  89.     BITDEF  LIB,SUMUSED,2        * set if we should bother to sum
  90.     BITDEF  LIB,DELEXP,3        * delayed expunge
  91.  
  92.  
  93. *----------------------------------------------------------------
  94. *
  95. *   Function Invocation Macros
  96. *
  97. *----------------------------------------------------------------
  98.  
  99. *------ CALLLIB for calling functions where A6 is already correct:
  100.  
  101. CALLLIB        MACRO   * functionOffset
  102.     IFGT NARG-1
  103.         FAIL    !!! CALLLIB MACRO - too many arguments !!!
  104.     ENDC
  105.         JSR        \1(A6)
  106.         ENDM
  107.  
  108.  
  109. *------ LINKLIB for calling functions where A6 is incorrect:
  110.  
  111. LINKLIB        MACRO   * functionOffset,libraryBase
  112.     IFGT NARG-2
  113.         FAIL    !!! LINKLIB MACRO - too many arguments !!!
  114.     ENDC
  115.         MOVE.L  A6,-(SP)
  116.         MOVE.L  \2,A6
  117.         CALLLIB \1
  118.         MOVE.L  (SP)+,A6
  119.         ENDM
  120.  
  121.     ENDC    ; EXEC_LIBRARIES_I
  122.